<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Receive and reply to CAN message</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('page_example_c_echo.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Receive and reply to CAN message </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><b>samples\example\c\canecho.c</b> </p><div class="fragment"><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment">** This software is furnished as Redistributable under the Kvaser Software Licence</span></div><div class="line"><span class="comment">** https://www.kvaser.com/canlib-webhelp/page_license_and_copyright.html</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">** Description:</span></div><div class="line"><span class="comment">** &quot;Echo Server&quot; for CANLIB. If you send a message to this little program,</span></div><div class="line"><span class="comment">** it will respond with the same message where the identifier is increased by one.</span></div><div class="line"><span class="comment">*/</span></div><div class="line"><span class="comment">/* First, include the whole known universe. */</span></div><div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;memory.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;windows.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;conio.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;time.h&gt;</span></div><div class="line"></div><div class="line"><span class="comment">// CANLIB requires the following #include.</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="canlib_8h.html">canlib.h</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef __BORLANDC__</span></div><div class="line"><span class="preprocessor">#pragma argsused</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"><span class="keywordtype">void</span> Usage(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])</div><div class="line">{</div><div class="line">        printf(<span class="stringliteral">&quot;\nCANLIB Echo Server\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;(Part of the CANLIB SDK from KVASER AB - http://www.kvaser.se)\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;This is a sample program which acts as an \&quot;Echo Server\&quot;.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;If you send a message to this little program, it will respond with\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;the same message where the identifier is increased by one.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;It requires a CAN interface supported by CANLIB, and runs\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;under most versions of Windows.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;\nUsage: tx [flags]\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;   -X          Use channel number X as source. (Default 0.)\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;   -B&lt;value&gt;   Set the bitrate. Value is any of 1000,500,250,125.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;               Default bitrate is 125 kbit/s.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;   -Sbbb,t1,t2 Set the bitrate using specified values for tseg1 and tseg2.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;               bbb=bitrate in bps.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;               t1=# of quanta before the sampling point, not including\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;                  the sync segment.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;               t2=# of quanta after the sampling point.\n&quot;</span>);</div><div class="line">        printf(<span class="stringliteral">&quot;   -q          Be quiet.\n&quot;</span>);</div><div class="line"></div><div class="line">        exit(1);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Global variables for the command-line options.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="keywordtype">int</span> Tseg1, Tseg2;</div><div class="line"><span class="keywordtype">int</span> Bitrate = <a class="code" href="canlib_8h.html#a29a9aafde6e861b4fffb72ad124aeed1">canBITRATE_125K</a>;</div><div class="line"><span class="keywordtype">int</span> Channel = 0;</div><div class="line"><span class="keywordtype">int</span> Quiet = 0;</div><div class="line"></div><div class="line"></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Check a status code and issue an error message if the code</span></div><div class="line"><span class="comment">// isn&#39;t canOK.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="keywordtype">void</span> Check(<span class="keywordtype">char</span>* <span class="keywordtype">id</span>, <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> stat)</div><div class="line">{</div><div class="line">        <span class="keywordflow">if</span> (stat != <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a>) {</div><div class="line">                <span class="keywordtype">char</span> buf[50];</div><div class="line">                buf[0] = <span class="charliteral">&#39;\0&#39;</span>;</div><div class="line">                <a class="code" href="group__can__general.html#ga01a7a415c95c579750bcdd95a1d245c4">canGetErrorText</a>(stat, buf, <span class="keyword">sizeof</span>(buf));</div><div class="line">                printf(<span class="stringliteral">&quot;%s: failed, stat=%d (%s)\n&quot;</span>, <span class="keywordtype">id</span>, (<span class="keywordtype">int</span>)stat, buf);</div><div class="line">        }</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Setup a CAN controller.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="keywordtype">int</span> InitCtrl(<span class="keywordtype">int</span> ctrl)</div><div class="line">{</div><div class="line">        <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> stat;</div><div class="line">        <a class="code" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a> hnd;</div><div class="line"></div><div class="line">        <span class="comment">//</span></div><div class="line">        <span class="comment">// First, open a handle to the CAN circuit. Specifying</span></div><div class="line">        <span class="comment">// canOPEN_EXCLUSIVE ensures we get a circuit that noone else</span></div><div class="line">        <span class="comment">// is using.</span></div><div class="line">        <span class="comment">//</span></div><div class="line">        printf(<span class="stringliteral">&quot;canOpenChannel, channel %d... &quot;</span>, ctrl);</div><div class="line">        hnd = <a class="code" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel</a>(ctrl, <a class="code" href="canlib_8h.html#afacd9e186d273d0dc24956ea0d433822">canOPEN_EXCLUSIVE</a>);</div><div class="line">        <span class="keywordflow">if</span> (hnd &lt; 0) {</div><div class="line">                Check(<span class="stringliteral">&quot;canOpenChannel&quot;</span>, (<a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>)hnd);</div><div class="line">                exit(1);</div><div class="line">        }</div><div class="line">        printf(<span class="stringliteral">&quot;OK.\n&quot;</span>);</div><div class="line"></div><div class="line">        <span class="comment">//</span></div><div class="line">        <span class="comment">// Using our new shiny handle, we specify the baud rate</span></div><div class="line">        <span class="comment">// using one of the convenient canBITRATE_xxx constants.</span></div><div class="line">        <span class="comment">//</span></div><div class="line">        <span class="comment">// The bit layout is in depth discussed in most CAN</span></div><div class="line">        <span class="comment">// controller data sheets, and on the web at</span></div><div class="line">        <span class="comment">// http://www.kvaser.se.</span></div><div class="line">        <span class="comment">//</span></div><div class="line">        printf(<span class="stringliteral">&quot;Setting the bus speed...&quot;</span>);</div><div class="line">        stat = <a class="code" href="group___c_a_n.html#ga7eb8c2e92cfae57e7ec5031818524301">canSetBusParams</a>(hnd, Bitrate, Tseg1, Tseg2, 1, 1, 0);</div><div class="line">        <span class="keywordflow">if</span> (stat &lt; 0) {</div><div class="line">                printf(<span class="stringliteral">&quot;canSetBusParams failed, stat=%d\n&quot;</span>, stat);</div><div class="line">        }</div><div class="line">        printf(<span class="stringliteral">&quot;OK.\n&quot;</span>);</div><div class="line"></div><div class="line">        <span class="comment">//</span></div><div class="line">        <span class="comment">// Then we start the ball rolling.</span></div><div class="line">        <span class="comment">//</span></div><div class="line">        printf(<span class="stringliteral">&quot;Go bus-on...&quot;</span>);</div><div class="line">        stat = <a class="code" href="group___c_a_n.html#ga99c7c99cc71580f8099a1407f4f9ea1a">canBusOn</a>(hnd);</div><div class="line">        <span class="keywordflow">if</span> (stat &lt; 0) {</div><div class="line">                printf(<span class="stringliteral">&quot;canBusOn failed, stat=%d\n&quot;</span>, stat);</div><div class="line">        }</div><div class="line">        printf(<span class="stringliteral">&quot;OK.\n&quot;</span>);</div><div class="line"></div><div class="line">        <span class="comment">// Return the handle; our caller will need it for</span></div><div class="line">        <span class="comment">// further exercising the CAN controller.</span></div><div class="line">        <span class="keywordflow">return</span> hnd;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Calculate the next valid identifier; valid as according to the CAN spec.</span></div><div class="line"><span class="comment">// Technically you will probably get along with sending the &quot;illegal&quot;</span></div><div class="line"><span class="comment">// identifiers too.</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="keywordtype">void</span> IncreaseId(<span class="keywordtype">long</span> *<span class="keywordtype">id</span>, <span class="keywordtype">int</span> flags)</div><div class="line">{</div><div class="line">        <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> i = *(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>*)<span class="keywordtype">id</span>;</div><div class="line"></div><div class="line">        i++;</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span> (flags &amp; <a class="code" href="canstat_8h.html#a56000a3f22f1408c26db4dc731aa4a9e">canMSG_STD</a>) {</div><div class="line">                <span class="keywordflow">if</span> (i &gt; 2031) i = 0;</div><div class="line">        }</div><div class="line">        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (flags &amp; canMSG_EXT) {</div><div class="line">                <span class="keywordflow">if</span> ((i &amp; 0x03F0) == 0x03F0) {</div><div class="line">                        i = (i &amp; 0xFFFFFC00) + 0x800 + (i &amp; 0x0F);</div><div class="line">                }</div><div class="line">                i &amp;= 0x1FFFFFFF;</div><div class="line">        }</div><div class="line">        *<span class="keywordtype">id</span> = i;</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> EchoLoop(<span class="keywordtype">void</span>)</div><div class="line">{</div><div class="line">        <a class="code" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a>       hnd;</div><div class="line">        <span class="keywordtype">long</span>            id;</div><div class="line">        <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a>       stat;</div><div class="line">        <a class="code" href="linlib_8h.html#a4ae1dab0fb4b072a66584546209e7d58">BYTE</a>            msg[8];</div><div class="line">        <span class="keywordtype">int</span>             Ready;</div><div class="line">        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>    i, dlc, flags;</div><div class="line">        <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>   time;</div><div class="line"></div><div class="line">        hnd = InitCtrl(Channel);</div><div class="line"></div><div class="line">        Ready = FALSE;</div><div class="line">        <span class="keywordflow">do</span> {</div><div class="line">                <span class="keywordflow">do</span> {</div><div class="line">                        <span class="comment">//</span></div><div class="line">                        <span class="comment">// Read a message; timeout after 250 ms.</span></div><div class="line">                        <span class="comment">//</span></div><div class="line">                        stat = <a class="code" href="group___c_a_n.html#gac01f98e282609b5f6aaf2b1eabfb83ec">canReadWait</a>(hnd, &amp;<span class="keywordtype">id</span>, msg, &amp;dlc, &amp;flags, &amp;time, 250);</div><div class="line">                        <span class="keywordflow">if</span> (stat != <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a>) <span class="keywordflow">break</span>;</div><div class="line"></div><div class="line">                        <span class="comment">//</span></div><div class="line">                        <span class="comment">// Calculate a new id.</span></div><div class="line">                        <span class="comment">//</span></div><div class="line">                        IncreaseId(&amp;<span class="keywordtype">id</span>, flags);</div><div class="line"></div><div class="line">                        <span class="comment">//</span></div><div class="line">                        <span class="comment">// Send the reply.</span></div><div class="line">                        <span class="comment">//</span></div><div class="line">                        stat = <a class="code" href="group___c_a_n.html#ga62c185329d6741c90102511e2f37983e">canWrite</a>(hnd, <span class="keywordtype">id</span>, msg, dlc,</div><div class="line">                                flags &amp; (canMSG_STD | canMSG_EXT | canMSG_RTR));</div><div class="line">                        Check(<span class="stringliteral">&quot;canWrite&quot;</span>, stat);</div><div class="line"></div><div class="line">                        <span class="comment">//</span></div><div class="line">                        <span class="comment">// Print the message we just sent.</span></div><div class="line">                        <span class="comment">//</span></div><div class="line">                        <span class="keywordflow">if</span> (!Quiet) {</div><div class="line">                                printf(<span class="stringliteral">&quot;%8ld%c%c%c  %u   &quot;</span>,</div><div class="line">                                        <span class="keywordtype">id</span>,</div><div class="line">                                        (flags &amp; canMSG_EXT) ? <span class="charliteral">&#39;x&#39;</span> : <span class="charliteral">&#39; &#39;</span>,</div><div class="line">                                        (flags &amp; canMSG_RTR) ? <span class="charliteral">&#39;R&#39;</span> : <span class="charliteral">&#39; &#39;</span>,</div><div class="line">                                        (flags &amp; canMSGERR_OVERRUN) ? <span class="charliteral">&#39;o&#39;</span> : <span class="charliteral">&#39; &#39;</span>,</div><div class="line">                                        dlc);</div><div class="line"></div><div class="line">                                <span class="comment">// Print the data bytes, but not for Remote Frames.</span></div><div class="line">                                <span class="keywordflow">if</span> ((flags &amp; canMSG_RTR) == 0) {</div><div class="line">                                        <span class="keywordflow">for</span> (i = 0; i &lt; dlc; i++) printf(<span class="stringliteral">&quot;%3u &quot;</span>, msg[i]);</div><div class="line">                                        <span class="keywordflow">for</span> (; i &lt; 8; i++) printf(<span class="stringliteral">&quot;    &quot;</span>);</div><div class="line">                                }</div><div class="line"></div><div class="line">                                <span class="comment">// Print the time, in raw format.</span></div><div class="line">                                printf(<span class="stringliteral">&quot;%08lu\n&quot;</span>, time);</div><div class="line">                        }</div><div class="line">                } <span class="keywordflow">while</span> (stat == <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a>);</div><div class="line"></div><div class="line">                <span class="comment">//</span></div><div class="line">                <span class="comment">// Check the keyboard.</span></div><div class="line">                <span class="comment">//</span></div><div class="line">                <span class="keywordflow">if</span> (_kbhit()) {</div><div class="line">                        <span class="keywordtype">int</span> c = _getch();</div><div class="line">                        <span class="keywordflow">switch</span> (c) {</div><div class="line">                        <span class="keywordflow">case</span> 27:</div><div class="line">                                Ready = TRUE;</div><div class="line">                        <span class="keywordflow">default</span>:</div><div class="line">                                ;</div><div class="line">                        }</div><div class="line">                }</div><div class="line">        } <span class="keywordflow">while</span> (!Ready);</div><div class="line"></div><div class="line">        (void)<a class="code" href="group___c_a_n.html#gaf1786cfbfd542b18b9c599d278837bd9">canBusOff</a>(hnd);</div><div class="line">        (void)<a class="code" href="group___c_a_n.html#ga49525373a4d08d93c651ec10f79dd36b">canClose</a>(hnd);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment"></span><span class="comment">//</span></div><div class="line"><span class="keywordtype">void</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])</div><div class="line">{</div><div class="line">        <span class="keywordtype">int</span> i;</div><div class="line"></div><div class="line">        <span class="comment">//</span></div><div class="line">        <span class="comment">// First, parse the command-line arguments.</span></div><div class="line">        <span class="comment">//</span></div><div class="line">        <span class="keywordflow">for</span> (i = 1; i &lt; argc; i++) {</div><div class="line">                <span class="keywordtype">int</span> tmp;</div><div class="line">                <span class="keywordtype">char</span> c;</div><div class="line">                <span class="keywordtype">int</span> tmp1, tmp2;</div><div class="line">                <span class="keywordflow">if</span> (sscanf(argv[i], <span class="stringliteral">&quot;-%d%c&quot;</span>, &amp;tmp, &amp;c) == 1) {</div><div class="line">                        Channel = tmp;</div><div class="line">                }</div><div class="line">                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sscanf(argv[i], <span class="stringliteral">&quot;-B%d%c&quot;</span>, &amp;tmp, &amp;c) == 1) {</div><div class="line">                        <span class="keywordflow">switch</span> (tmp) {</div><div class="line">                        <span class="keywordflow">case</span> 1000: Bitrate = <a class="code" href="canlib_8h.html#ac823cae7d94763607a7ca40fcdb5196d">canBITRATE_1M</a>; <span class="keywordflow">break</span>;</div><div class="line">                        <span class="keywordflow">case</span> 500: Bitrate = <a class="code" href="canlib_8h.html#ae72ee3c12379c4817de3b53c7cc6d89c">canBITRATE_500K</a>; <span class="keywordflow">break</span>;</div><div class="line">                        <span class="keywordflow">case</span> 250: Bitrate = <a class="code" href="canlib_8h.html#a87f618db13ec4f48610def72cfb40969">canBITRATE_250K</a>; <span class="keywordflow">break</span>;</div><div class="line">                        <span class="keywordflow">case</span> 125: Bitrate = <a class="code" href="canlib_8h.html#a29a9aafde6e861b4fffb72ad124aeed1">canBITRATE_125K</a>; <span class="keywordflow">break</span>;</div><div class="line">                        <span class="keywordflow">default</span>: Usage(argc, argv);</div><div class="line">                        }</div><div class="line">                }</div><div class="line">                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sscanf(argv[i], <span class="stringliteral">&quot;-S%d,%d,%d%c&quot;</span>, &amp;tmp, &amp;tmp1, &amp;tmp2, &amp;c) == 3) {</div><div class="line">                        Bitrate = tmp;</div><div class="line">                        Tseg1 = tmp1;</div><div class="line">                        Tseg2 = tmp2;</div><div class="line">                }</div><div class="line">                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strcmp(argv[i], <span class="stringliteral">&quot;-q&quot;</span>) == 0) {</div><div class="line">                        Quiet++;</div><div class="line">                }</div><div class="line">                <span class="keywordflow">else</span> {</div><div class="line">                        Usage(argc, argv);</div><div class="line">                }</div><div class="line">        }</div><div class="line"></div><div class="line">        <span class="keywordflow">if</span> (!Quiet) printf(<span class="stringliteral">&quot;Starting...\n&quot;</span>);</div><div class="line">        <span class="comment">//</span></div><div class="line">        <span class="comment">// Initialize CANLIB.</span></div><div class="line">        <span class="comment">//</span></div><div class="line">        <a class="code" href="group__can__general.html#gaff1ec1d3416d3bdd56336a7b9ac008b1">canInitializeLibrary</a>();</div><div class="line"></div><div class="line">        EchoLoop();</div><div class="line"></div><div class="line">        printf(<span class="stringliteral">&quot;\nThat&#39;s all for today!\n&quot;</span>);</div><div class="line">}</div><div class="line"></div></div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="page_canlib.html">CAN bus API (CANlib)</a></li><li class="navelem"><a class="el" href="page_user_guide_canlib_samples.html">Sample Programs (CANlib)</a></li>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
